From 44fd380acacfb556e166c9cf653a20356b9b4d0f Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 12 Mar 2004 13:34:06 +0000 Subject: [PATCH] bitkeeper revision 1.787 (4051bc4ehrQHo7L4maQXzA3WoPbfmw) setup.c, config.in: Detect and support VIA C3 processors. --- xen/arch/i386/setup.c | 5 ++- xenolinux-2.4.25-sparse/arch/xeno/config.in | 10 ++++- .../arch/xeno/kernel/setup.c | 42 ++++++++++++++++++- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/xen/arch/i386/setup.c b/xen/arch/i386/setup.c index 95b0292625..aaf4fbea59 100644 --- a/xen/arch/i386/setup.c +++ b/xen/arch/i386/setup.c @@ -203,8 +203,11 @@ void __init identify_cpu(struct cpuinfo_x86 *c) break; case X86_VENDOR_UNKNOWN: /* Connectix Virtual PC reports this */ break; + case X86_VENDOR_CENTAUR: + break; default: - panic("Only support Intel processors (P6+)\n"); + printk("Unknown CPU identifier (%d): continuing anyway, " + "but might fail.\n", c->x86_vendor); } printk("CPU caps: %08x %08x %08x %08x\n", diff --git a/xenolinux-2.4.25-sparse/arch/xeno/config.in b/xenolinux-2.4.25-sparse/arch/xeno/config.in index 0bc6d0867d..57e339165b 100644 --- a/xenolinux-2.4.25-sparse/arch/xeno/config.in +++ b/xenolinux-2.4.25-sparse/arch/xeno/config.in @@ -39,7 +39,9 @@ choice 'Processor family' \ "Pentium-Pro/Celeron/Pentium-II CONFIG_M686 \ Pentium-III/Celeron(Coppermine) CONFIG_MPENTIUMIII \ Pentium-4 CONFIG_MPENTIUM4 \ - Athlon/Duron/K7 CONFIG_MK7" Pentium-Pro + Athlon/Duron/K7 CONFIG_MK7 \ + Opteron/Athlon64/Hammer/K8 CONFIG_MK8 \ + VIA-C3-2 CONFIG_MVIAC3_2" Pentium-Pro define_bool CONFIG_X86_WP_WORKS_OK y define_bool CONFIG_X86_INVLPG y @@ -64,10 +66,16 @@ fi if [ "$CONFIG_MPENTIUM4" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 7 fi +if [ "$CONFIG_MK8" = "y" ]; then + define_bool CONFIG_MK7 y +fi if [ "$CONFIG_MK7" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 6 define_bool CONFIG_X86_USE_3DNOW y fi +if [ "$CONFIG_MVIAC3_2" = "y" ]; then + define_int CONFIG_X86_L1_CACHE_SHIFT 5 +fi if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then tristate 'BIOS Enhanced Disk Drive calls determine boot disk (EXPERIMENTAL)' CONFIG_EDD diff --git a/xenolinux-2.4.25-sparse/arch/xeno/kernel/setup.c b/xenolinux-2.4.25-sparse/arch/xeno/kernel/setup.c index 4b12a14827..762a9946ae 100644 --- a/xenolinux-2.4.25-sparse/arch/xeno/kernel/setup.c +++ b/xenolinux-2.4.25-sparse/arch/xeno/kernel/setup.c @@ -48,6 +48,7 @@ #include #include #include +#include /* dev_(de)activate */ /* * Point at the empty zero page to start with. We map the real shared_info @@ -444,6 +445,39 @@ static void __init display_cacheinfo(struct cpuinfo_x86 *c) l2size, ecx & 0xFF); } +static void __init init_c3(struct cpuinfo_x86 *c) +{ + /* Test for Centaur Extended Feature Flags presence */ + if (cpuid_eax(0xC0000000) >= 0xC0000001) { + /* store Centaur Extended Feature Flags as + * word 5 of the CPU capability bit array + */ + c->x86_capability[5] = cpuid_edx(0xC0000001); + } + + switch (c->x86_model) { + case 9: /* Nehemiah */ + default: + get_model_name(c); + display_cacheinfo(c); + break; + } +} + +static void __init init_centaur(struct cpuinfo_x86 *c) +{ + /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; + 3DNow is IDd by bit 31 in extended CPUID (1*3231) anyway */ + clear_bit(0*32+31, &c->x86_capability); + + switch (c->x86) { + case 6: + init_c3(c); + break; + default: + panic("Unsupported Centaur CPU (%i)\n", c->x86); + } +} static int __init init_amd(struct cpuinfo_x86 *c) { @@ -630,6 +664,8 @@ void __init get_cpu_vendor(struct cpuinfo_x86 *c) c->x86_vendor = X86_VENDOR_INTEL; else if (!strcmp(v, "AuthenticAMD")) c->x86_vendor = X86_VENDOR_AMD; + else if (!strcmp(v, "CentaurHauls")) + c->x86_vendor = X86_VENDOR_CENTAUR; else c->x86_vendor = X86_VENDOR_UNKNOWN; } @@ -819,8 +855,12 @@ void __init identify_cpu(struct cpuinfo_x86 *c) init_intel(c); break; + case X86_VENDOR_CENTAUR: + init_centaur(c); + break; + default: - panic("Unsupported CPU vendor\n"); + printk("Unsupported CPU vendor (%d) -- please report!\n"); } printk(KERN_DEBUG "CPU: After vendor init, caps: %08x %08x %08x %08x\n", -- 2.30.2